#define _CRT_SECURE_NO_WARNINGS 1
#include"SList.h"

void test1()
{
	SLTNode* plist = NULL;


	SListPushBack(&plist, 1);
	SListPushBack(&plist, 2);
	SListPushBack(&plist, 3);
	SListPushBack(&plist, 4);

	SListPrint(plist);

	SListPushFront(&plist, 1);
	SListPushFront(&plist, 2);
	SListPushFront(&plist, 3);
	SListPushFront(&plist, 4);

	SListPrint(plist);

	SListPopFront(&plist);
	SListPopFront(&plist);
	SListPopFront(&plist);
	SListPopFront(&plist);
	SListPopFront(&plist);
	SListPopFront(&plist);
	SListPopFront(&plist);
	SListPopFront(&plist);
	SListPopFront(&plist);


	SListPrint(plist);
	
}



void test2()
{
	SLTNode* plist = NULL;

	SListPushBack(&plist, 1);
	SListPushBack(&plist, 2);
	SListPushBack(&plist, 3);
	SListPushBack(&plist, 4);

	SLTNode* pos = SListFind(plist, 1);
	if (pos != NULL)
	{
		//SListInsert(&plist, pos, 10);
		//SListErase(&plist, pos);
		//SListInsertAfter(pos, 10);
		SListEraseAfter(pos);
	}
	else
	{
		printf("Find Fail!\n");
		exit(-1);
	}

	SListPrint(plist);

	SListDestory(&plist);
}


int main()
{
	//test1();
	test2();



	return 0;
}